<?php
require_once "Mail.php";
$data = file_get_contents("php://input"); 
//raw POST data$data = json_decode($data, true);
// Commit information
$project_name = $data["project_name"];
foreach($data["revisions"] as $d) {        
$revision = $d["revision"];
$author = $d["author"];
$message = $d["message"];}

$from = '**********';
$to = '*********';
$subject = '['. $project_name .'] r'. 
$revision .' committed - '. 
$message;$body = 'Author: '. $author ."\n";

$body .= 'Comments: '. 
$message ."\n";$body .= 'URL: http://code.google.com/p/[project-name]/source/detail?r=' . 
$revision;
// Stick your GMAIL SMTP info here! ------------------------------
$host = "smtp.gmail.com";$port = "587";$username = "**********";$password = "**********";
// --------------------------------------------------------------
$headers = array ('From' => $from,  'To' => $to,  'Subject' => $subject);$smtp = Mail::factory('smtp',  array ('host' => $host,    'port' => $port,    'auth' => true,    'username' => $username,    'password' => $password));$mail = $smtp->send($to, $headers, $body);
$log = fopen("log.txt","a");fputs($log, $subject);fputs($log, "\n");if (PEAR::isError($mail)) {  fputs($log, $mail->getMessage());  fputs($log, "\n");  fputs($log, "\n");} else {  fputs($log, "Message successfully sent!");  fputs($log, "\n");  fputs($log, "\n");}?>